
<%@ page import="com.pilates.Matricula" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'matricula.label', default: 'Matricula')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            
            <g:form action="list">
            	<table>
            		<tr><td>Pesquisar: </td>
            		<td><input type="text" name="search" value="${flash?.search}"/></td>
            		<td>
            		<input type="hidden" name="buttonSearch" value="1">
            		<g:actionSubmit class="save" action="list" value="${message(code: 'default.button.pesquisar.label', default: 'Pesquisar')}" />
            		</td></tr>
            	</table>
            </g:form>
            	
            <div class="list">  
            
            	<table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'matricula.id.label', default: 'Id')}" />
                        
                            <th><g:message code="matricula.pessoa.label" default="Pessoa" /></th>
                   	    
                            <th><g:message code="matricula.turma.label" default="Turma" /></th>
                   	    
                            <g:sortableColumn property="experimental" title="${message(code: 'matricula.experimental.label', default: 'Experimental')}" />
                        
                            <g:sortableColumn property="data" title="${message(code: 'matricula.data.label', default: 'Data')}" />
                        
                            <g:sortableColumn property="ativo" title="${message(code: 'matricula.ativo.label', default: 'Ativo')}" />
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${matriculaInstanceList}" status="i" var="matriculaInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="edit" id="${matriculaInstance.id}">${fieldValue(bean: matriculaInstance, field: "id")}</g:link></td>
                        
                            <td>${fieldValue(bean: matriculaInstance, field: "pessoa")}</td>
                        
                            <td>${fieldValue(bean: matriculaInstance, field: "turma")}</td>
                        
                            <td><g:formatBoolean boolean="${matriculaInstance.experimental}" true="Sim" false="Nao" /></td>
                        
                            <td><g:formatDate date="${matriculaInstance.data}" /></td>
                        
                            <td>${matriculaInstance?.ativo?.toString()}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${matriculaInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
